﻿/*版权声明
 * 
 * 本 WebName:IMIS_ERP 由
 * 河北大学 信管团队 开发
 * 如有任何疑问请联系开发人员
 * 
 * 项目开发者
 * 负责人：朱胜贤
 * 成员：水亚亚、孙旭峰、张文元、项玥、吕芳、吴凡、谢静、李亚慧
 * 
 * 如有任何疑问请联系：河北大学信管团队
 * QQ：196396337
 * Email:zagelover@163.com
 * HomePage：http://sxgzs.com/
 * 
 * CopyRight (c) 河北大学信管团队 2010~2020
 */

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
namespace IMIS_ERP.Web.Factory_Info
{
    public partial class Modify_Mine : Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                IMIS_ERP.BLL.Factory_People bll = new BLL.Factory_People();
                string fiID = bll.GetModel(Session["UId"].ToString()).fpFiID;
                ShowInfo(fiID);
            }  
        }

        /// <summary>绑定数据：详细信息
        ///     <remarks>2010-12-08 河大信管团队</remarks>
        /// </summary>
        /// <param name="fiID">编号</param>
        private void ShowInfo(string fiID)
        {
            IMIS_ERP.BLL.Factory_Info bll = new IMIS_ERP.BLL.Factory_Info();
            IMIS_ERP.Model.Factory_Info model = bll.GetModel(fiID);
            this.lblfiID.Text = model.fiID;
            this.txtfiName.Text = model.fiName;
            this.txtfIFpID.Text = model.fIFpID;
            this.txtfiAddress.Text = model.fiAddress;
            this.txtfiPhone.Text = model.fiPhone;
            this.txtfiCredit.Text = model.fiCredit.ToString();
            this.txtfiHuID.Text = model.fiHuID;
            this.lblfiProvince.Text = model.fiProvince;
            this.lblfiCity.Text = model.fiCity;
            this.lblfiArea.Text = model.fiArea;
            this.lblfiLevel.Text = model.fiLevel;
            this.lblfiAiName.Text = model.fiAiName;
        }

        public void btnSave_Click(object sender, EventArgs e)
        {


            IMIS_ERP.Model.Factory_Info model = new IMIS_ERP.Model.Factory_Info();
            model.fiID = this.lblfiID.Text.Trim();
            model.fiName = this.txtfiName.Text;
            model.fIFpID = this.txtfIFpID.Text;
            model.fiProvince = this.lblfiProvince.Text.Trim();
            model.fiCity = this.lblfiCity.Text.Trim();
            model.fiArea = this.lblfiArea.Text.Trim();
            model.fiAddress = this.txtfiAddress.Text;
            model.fiPhone = this.txtfiPhone.Text;
            model.fiCredit = decimal.Parse(this.txtfiCredit.Text.Trim());
            model.fiHuID = this.txtfiHuID.Text;
            model.fiLevel = this.lblfiLevel.Text.Trim();
            model.fiAiName = this.lblfiAiName.Text.Trim();

            IMIS_ERP.BLL.Factory_Info bll = new IMIS_ERP.BLL.Factory_Info();
            if (bll.Update(model))
            {
                lblMessage.Text = "修改信息成功";
            }
            else
            {
                lblMessage.Text = "修改信息失败,请重试";
            }

        }


    }
}
